!function(a) {
    a.fn.typeWatch = function(b) {
        function d(b, d) {
            var e = a(b.el).val();
            (e.length > c.captureLength && e.toUpperCase() != b.text || d && e.length > c.captureLength) && (b.text = e.toUpperCase(), 
            b.cb(e));
        }
        function e(b) {
            var e, f;
            ("TEXT" == b.type.toUpperCase() || "TEXTAREA" == b.nodeName.toUpperCase()) && (e = {
                timer: null,
                text: a(b).val().toUpperCase(),
                cb: c.callback,
                el: b,
                wait: c.wait
            }, c.highlight && a(b).focus(function() {
                this.select();
            }), f = function(a) {
                var f, b = e.wait, c = !1;
                13 == a.keyCode && "TEXT" == this.type.toUpperCase() && (b = 1, c = !0), f = function() {
                    d(e, c);
                }, clearTimeout(e.timer), e.timer = setTimeout(f, b);
            }, a(b).keydown(f));
        }
        var c = a.extend({
            wait: 750,
            callback: function() {},
            highlight: !0,
            captureLength: 2
        }, b);
        return this.each(function() {
            e(this);
        });
    };
}(jQuery);